#ifndef CONFIG_MANAGER_H
#define CONFIG_MANAGER_H

#include <Arduino.h>

// 配置类
class ConfigManager {
private:
  int maxSpeed;
  int safeDistance;
  String driveMode;

public:
  ConfigManager() {
    maxSpeed = 200;
    safeDistance = 15;
    driveMode = "DifferentialDrive";
  }

  int getMaxSpeed() {
    return maxSpeed;
  }

  void setMaxSpeed(int speed) {
    maxSpeed = constrain(speed, 0, 255);
  }

  int getSafeDistance() {
    return safeDistance;
  }

  void setSafeDistance(int distance) {
    safeDistance = max(5, distance);
  }

  String getDriveMode() {
    return driveMode;
  }

  void setDriveMode(String mode) {
    driveMode = mode;
  }
};

#endif // CONFIG_MANAGER_H